package nl.boelen.game.gfx;

public class Colors {

    public static int get(int c1, int c2, int c3, int c4) {
        return (get(c4) << 24) + (get(c3) << 16) + (get(c2) << 8) + get(c1);
    }

    public static int get(int color) {
        if (color < 0) {
            return 255;
        }
        int r = color / 100 % 10;
        int g = color / 10 % 10;
        int b = color % 10;
        if(r > 5 || g > 5 || b > 5){
            return 255;
        }
        return r * 6 * 6 + g * 6 + b;
    }
}
